const success = (res, data = null, message = '操作成功') => {
  res.json({
    success: true,
    message,
    data,
  })
}

const error = (res, message = '操作失败', status = 400) => {
  res.status(status).json({
    success: false,
    message,
  })
}

module.exports = { success, error }
